# 配置文件
import os
from dotenv import load_dotenv

load_dotenv()

class Config:
    # DeepSeek API配置
    DEEPSEEK_API_KEY = os.getenv("DEEPSEEK_API_KEY", "")
    DEEPSEEK_BASE_URL = "https://api.deepseek.com/v1"
    
    # 数据库配置
    DATABASE_URL = "sqlite:///./toutiao_auto.db"
    
    # 应用配置
    SECRET_KEY = os.getenv("SECRET_KEY", "your-secret-key-here")
    DEBUG = os.getenv("DEBUG", "True").lower() == "true"
    
    # 头条相关配置
    TOUTIAO_LOGIN_URL = "https://mp.toutiao.com/auth/page/login/"
    TOUTIAO_PUBLISH_URL = "https://mp.toutiao.com/profile_v4/graphic/publish"
    TOUTIAO_TITLE_URL = "https://mp.toutiao.com/profile_v4/graphic/articles"
    
    # 浏览器配置
    BROWSER_HEADLESS = os.getenv("BROWSER_HEADLESS", "False").lower() == "true"

    #头条主页
    TOUTIAO_HOME_URL = "https://mp.toutiao.com/"
    
    # 文件存储
    UPLOAD_DIR = "uploads"
    COOKIE_DIR = "cookies"

# 创建必要的目录
os.makedirs(Config.UPLOAD_DIR, exist_ok=True)
os.makedirs(Config.COOKIE_DIR, exist_ok=True)
